home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / web / fweb / fweb-1.40 / manual / f_to_web.f < prev    next >
Text File  |  1993-10-29  |  2KB  |  78 lines

  1.  
  2. C FTANGLE v1.30, created with UNIX on "Tuesday, May 11, 1993 at 10:55." 
  3. C COMMAND LINE: "ftangle ./f_to_web -zdemos.sty -=f_to_web.f"
  4. C RUN TIME: "Thursday, June 10, 1993 at 12:39."
  5. C WEB FILE:    "./f_to_web.web"
  6. C CHANGE FILE: (none)
  7. C* 1: * 
  8. *line 35 "./f_to_web.web"
  9.       program main
  10. C* 2: * 
  11. *line 54 "./f_to_web.web"
  12.       integer i
  13.       real x
  14.       common/test/x,i
  15. C* :2 * 
  16. *line 37 "./f_to_web.web"
  17.       
  18.       
  19. C* Initialize values.  Long comments should be done in standard    C style and m
  20. Cay be continued across lines.  
  21.       x=-3.14159e-11
  22.       i=1
  23.       call see
  24. C Print results.  (Short comments can be done like this.)   
  25.       end
  26. C* :1 * 
  27. C* 3: * 
  28. *line 66 "./f_to_web.web"
  29.       subroutine see
  30. C* 2: * 
  31. *line 54 "./f_to_web.web"
  32.       integer i
  33.       real x
  34.       common/test/x,i
  35. C* :2 * 
  36. *line 69 "./f_to_web.web"
  37.       
  38. C You can abbreviate the name if it has already     appeared in full. 
  39.       write(6,90000)x,i
  40. 90000  format(' x = ',1pe10.2,', i = ',i2)
  41.       return
  42.       end
  43. C* :3 * 
  44. C* 4: * 
  45. *line 82 "./f_to_web.web"
  46. C* 4: * 
  47. *line 83 "./f_to_web.web"
  48.       integer function f(a,b,n)
  49.         
  50.         integer n
  51.         real a(0:n-1),b(0:n-1)
  52.         
  53.         integer k
  54.         
  55. C* You can (and should) use a |do| loop for the following, but the |for| 
  56. Cconstruction is more flexible in general, so we use it to demonstrate. 
  57.         CONTINUE
  58. C ---  "for(k=0; k<n; k++)" ---
  59.         k=0
  60. 90001   IF(k.LT.n)THEN
  61.           a(k)=k
  62.           b(k)=k**2
  63. C* In Ratfor and Fortran, you can use pretty 
  64. Calternatives for archaic Fortran constructions such as~\.{.lt.} or~\.{**}. 
  65. C --- Reinitialization of "for(k=0; k<n; k++)" ---
  66.           k=k+1
  67.           GOTO 90001
  68.         ENDIF
  69.         
  70.         CONTINUE
  71. C ---  "return n" ---
  72.         f=n
  73.         RETURN
  74. C/ It's easy to return values from functions. 
  75.       END
  76.       
  77. C* :4 * 
  78.